package day7.Exer;

public class Cat extends Animal {
    private double weight;
    public Cat(String name,int strength,double weight){
        super(name, strength);
        this.weight=weight;
    }

    public double getWeight() {
        return weight;
    }

    public void setWeight(double weight) {
        this.weight = weight;
    }
    public boolean Catch(Mouse a,String chosen){
        if(chosen.equals("yes")){
            System.out.println(getName()+"抓住了"+a.getName()+"吃掉");
            setStrength(100);
            a.setStrength(0);
            System.out.println(getName()+"的体力为"+getStrength()+"\n"+a.getName()+"的体力为"+a.getStrength());
            return true;
        }else{
            System.out.println(getName()+"没抓住。"+a.getName()+"跑掉了");
            System.out.println(getName()+"的体力为"+getStrength()+"\n"+a.getName()+"的体力为"+a.getStrength());
            return false;
        }
    }
}
